/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author BATAQUERO
 */
@Entity
@Table(name = "detalle_bitacora_semanal")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DetalleBitacoraSemanal.findAll", query = "SELECT d FROM DetalleBitacoraSemanal d"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByIdDetalleBitacoraSemanal", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.idDetalleBitacoraSemanal = :idDetalleBitacoraSemanal"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByHito", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.hito = :hito"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByDia", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.dia = :dia"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByActividad", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.actividad = :actividad"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByDuracionHoras", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.duracionHoras = :duracionHoras"),
    @NamedQuery(name = "DetalleBitacoraSemanal.findByObservaciones", query = "SELECT d FROM DetalleBitacoraSemanal d WHERE d.observaciones = :observaciones")})
public class DetalleBitacoraSemanal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_detalle_bitacora_semanal")
    private Integer idDetalleBitacoraSemanal;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "hito")
    private String hito;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dia")
    @Temporal(TemporalType.DATE)
    private Date dia;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "actividad")
    private String actividad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "duracion_horas")
    private int duracionHoras;
    @Size(max = 1000)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "id_bitacora_semanal", referencedColumnName = "id_bitacora_semanal")
    @ManyToOne(optional = false)
    private SeguimientoBitacoraSemanal idBitacoraSemanal;

    public DetalleBitacoraSemanal() {
    }

    public DetalleBitacoraSemanal(Integer idDetalleBitacoraSemanal) {
        this.idDetalleBitacoraSemanal = idDetalleBitacoraSemanal;
    }

    public DetalleBitacoraSemanal(Integer idDetalleBitacoraSemanal, String hito, Date dia, String actividad, int duracionHoras) {
        this.idDetalleBitacoraSemanal = idDetalleBitacoraSemanal;
        this.hito = hito;
        this.dia = dia;
        this.actividad = actividad;
        this.duracionHoras = duracionHoras;
    }

    public Integer getIdDetalleBitacoraSemanal() {
        return idDetalleBitacoraSemanal;
    }

    public void setIdDetalleBitacoraSemanal(Integer idDetalleBitacoraSemanal) {
        this.idDetalleBitacoraSemanal = idDetalleBitacoraSemanal;
    }

    public String getHito() {
        return hito;
    }

    public void setHito(String hito) {
        this.hito = hito;
    }

    public Date getDia() {
        return dia;
    }

    public void setDia(Date dia) {
        this.dia = dia;
    }

    public String getActividad() {
        return actividad;
    }

    public void setActividad(String actividad) {
        this.actividad = actividad;
    }

    public int getDuracionHoras() {
        return duracionHoras;
    }

    public void setDuracionHoras(int duracionHoras) {
        this.duracionHoras = duracionHoras;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public SeguimientoBitacoraSemanal getIdBitacoraSemanal() {
        return idBitacoraSemanal;
    }

    public void setIdBitacoraSemanal(SeguimientoBitacoraSemanal idBitacoraSemanal) {
        this.idBitacoraSemanal = idBitacoraSemanal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleBitacoraSemanal != null ? idDetalleBitacoraSemanal.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleBitacoraSemanal)) {
            return false;
        }
        DetalleBitacoraSemanal other = (DetalleBitacoraSemanal) object;
        if ((this.idDetalleBitacoraSemanal == null && other.idDetalleBitacoraSemanal != null) || (this.idDetalleBitacoraSemanal != null && !this.idDetalleBitacoraSemanal.equals(other.idDetalleBitacoraSemanal))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Persistencia.DetalleBitacoraSemanal[ idDetalleBitacoraSemanal=" + idDetalleBitacoraSemanal + " ]";
    }
    
}
